package socketmvc.server.ws;

import org.tio.core.ChannelContext;
import org.tio.core.intf.Packet;
import org.tio.websocket.common.WsSessionContext;
import org.tio.websocket.server.WsTioServerListener;

public class WsServerListener extends WsTioServerListener {
    public void onAfterConnected(ChannelContext channelContext, boolean isConnected, boolean isReconnect) {
        WsSessionContext wsSessionContext = new WsSessionContext();
        channelContext.set(wsSessionContext);
    }

    public void onAfterDecoded(ChannelContext channelContext, Packet packet, int packetSize) {
    }

    public void onAfterSent(ChannelContext channelContext, Packet packet, boolean isSentSuccess) {
    }

    public void onBeforeClose(ChannelContext channelContext, Throwable throwable, String remark, boolean isRemove) {

    }

    public void onAfterHandled(ChannelContext channelContext, Packet packet, long cost) {
    }

    public void onAfterReceivedBytes(ChannelContext channelContext, int receivedBytes) {
    }

    public boolean onHeartbeatTimeout(ChannelContext channelContext, Long interval, int heartbeatTimeoutCount) {
        return false;
    }
}
